Skip to content

docs: fix wire-contract doc inaccuracies from post-merge review#75

Merged
yuanhao merged 1 commit into
mainfrom
fix/wire-contract-docs
Jul 14, 2026
Merged

docs: fix wire-contract doc inaccuracies from post-merge review#75
yuanhao merged 1 commit into
mainfrom
fix/wire-contract-docs

Conversation

@yuanhao

@yuanhao yuanhao commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Comment-accuracy review of the merged #72 found three factual errors and two enforcement gaps:

  1. CHANGELOG downgrade claim was backwards — 0.13-written session files load in yoagent < 0.13 without error but silently drop the renamed fields (cache/total token counts → 0; errorMessage/providerMetadata — including Gemini thought signatures — lost). Silent corruption is the more dangerous failure mode to leave undocumented; now stated.
  2. serde floor rationale was fiction twice overrename_all_fields shipped in 1.0.177 (July 2023), not 1.0.186 nor 1.0.181. Floor lowered to the real boundary; verified the crate builds+tests at exactly 1.0.177.
  3. persistence.md contradicted the frozen wire shape — its JSON example still showed cache_read/cache_write/total_tokens.
  4. messages-events.md now covers the retry case — a transient mid-stream provider error restarts from a fresh MessageStart with no closing MessageEnd; clients must reset accumulation at MessageStart or they duplicate replayed text.
  5. The exhaustive-match freeze promise is now fully enforcedEVENT_VARIANT_COUNT assertion fails when a variant is added to the match without a sample in all_agent_events (previously the new variant's tag/round-trip went silently untested).

Verified: 393 tests green at both serde 1.0.177 (floor) and latest; clippy -Dwarnings clean.

🤖 Generated with Claude Code

- CHANGELOG downgrade claim was backwards: 0.13-written files DO load
  in older versions — with silent data loss (cache/total counts read 0;
  errorMessage/providerMetadata incl. Gemini thought signatures
  dropped). Documented the real failure mode.
- serde floor corrected to 1.0.177, the release that actually added
  rename_all_fields (verified against serde release history; 1.0.181
  matched no meaningful boundary). Floor build verified.
- persistence.md JSON example still showed pre-0.13 snake_case usage
  keys — updated with a load-compat note.
- messages-events.md: accumulation must reset at each MessageStart
  (mid-stream provider retry emits a fresh MessageStart with no closing
  MessageEnd); placeholder phrasing corrected.
- serialization_test: EVENT_VARIANT_COUNT assertion closes the
  unenforced half of the freeze promise (variant added to the match
  without a sample in all_agent_events now fails the test).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yuanhao
yuanhao merged commit 9a02211 into main Jul 14, 2026
5 checks passed
@yuanhao
yuanhao deleted the fix/wire-contract-docs branch July 14, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant